﻿define(
    [
        'durandal/app',
        'services/logger'
    ],
    function (app, logger) {
        ///
        ///  CONSTRUCTOR
        ///
        var users = function () {
            this.displayName = 'Users';
            this.description = 'List of Users';
        };

        ///
        ///  PROTOTYPES
        ///
        users.prototype = {
            viewAttached: function (view) {
                //you can get the view after it's bound and connected to it's parent dom node if you want
                //app.showMessage('Users screen is attached...');
                logger.log('Users screen is attached...', null, null, true);
            },
            canDeactivate: function () {
                //the router's activator calls this function to see if it can leave the screen
                return app.showMessage('Are you sure you want to leave this page?', 'Navigate', ['Yes', 'No']);
            }
        };

        return users;
    });